<?php
	session_start();
	if(!$_SESSION['IsLogin'] || $_SESSION['IsLogin']!='true'){
		echo "<script>alert('登录超时或未登录，请先登录！');location.href='./Login.php';</script>";
	}
		

	$id = $_REQUEST["id"]??"";
	if(strlen($id)==0){
		echo "<script>alert('参数错误');location.href='./Index.php';</script>";
		return;
	}
	include "db.php";
	$result = mysqli_query($conn,"DELETE FROM Articles WHERE ArticleId=$id;");
	if($result){
		echo "<script>alert('删除成功');location.href='./Index.php';</script>";
	}else{
		echo "<script>alert('删除失败');location.href='./Index.php';</script>";
	}
?>